<template>
  <div>
    <el-button @click='handleClick'>打开弹框</el-button>
    <Dialog ref="dialog" :id="id" v-model:open="open" />
  </div>
</template>

<script setup>
import Dialog from './components/dialog.vue';
const id = ref('');
const dialog = ref();
const open = ref(false);

const handleClick = () => {
  id.value = '123';
  open.value = true;
  dialog.value.showModal();
}
</script>